from flask_wtf import Form
from wtforms import StringField, SubmitField, PasswordField, BooleanField
from wtforms.validators import DataRequired, Length, Email, URL


class SignupForm(Form):
    email = StringField('Email', validators=[DataRequired(), Length(1, 64),
                                             Email()])
    username = StringField('Username', validators=[DataRequired(), Length(1, 16)])
    password = PasswordField('Password', validators=[DataRequired(), Length(1, 16)])
    retype_password = PasswordField('Retype', validators=[DataRequired()])
    submit = SubmitField('Sign Up')


class LoginForm(Form):
    username = StringField('username', validators=[DataRequired(), Length(1, 16)])
    password = PasswordField('Password', validators=[DataRequired(), Length(1, 16)])
    remember_me = BooleanField('Remember Me')
    submit = SubmitField('Log In')

class SettingsForm(Form):
    username = StringField('Username')
    email = StringField('Email')
    location = StringField('Location')
    website = StringField('Website', validators=[URL()])
    bio = StringField('Bio')
    twitter = StringField('Twitter')
    weibo = StringField('Weibo')
    github = StringField('GitHub')
    instagram = StringField('Instagram')
    stackoverflow = StringField('Stack Overflow')
    submit = SubmitField('Submit')
